package com.taxshare.purchaser.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.taxshare.mybatis.pager.PageRequest;
import com.taxshare.purchaser.entity.ElectronicledgerEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.taxshare.purchaser.view.dto.InvoiceCollectionQueryAllDTO;
import com.taxshare.purchaser.view.dto.InvoiceSummaryDTO;
import com.taxshare.purchaser.view.vo.ElectronicLedgerVO;
import com.taxshare.purchaser.view.vo.InvoiceResultSummaryVO;
import com.taxshare.purchaser.view.vo.InvoiceSummaryVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author luozhongyi
 * @ClassName: ElectronicledgerMapper
 * @Description:
 * @since 2021-03-29
 */
@Mapper
public interface ElectronicledgerMapper extends BaseMapper<ElectronicledgerEntity> {
    int updateCompanyInitFlag(@Param("taxNo") String taxNo);

    int updateAuthBatchError(@Param("list") List<Map<String, String>> list, @Param("code") String code, @Param("content") String content);

    String queryAuthPass(@Param("taxNo") String taxNo);

    IPage<List<Map<String, Object>>> selectPageByParam(IPage<ElectronicLedgerVO> iPage, @Param(Constants.WRAPPER) Wrapper<ElectronicledgerEntity> wrapper);

    /**
     * 申请统计汇总表（查询）
     *
     * @param query
     * @return
     */
    List<InvoiceSummaryVO> selectSummary(@Param("query") InvoiceSummaryDTO query);

    /**
     * 申请统计结果汇总表查询
     *
     * @param query
     * @return
     */
    List<InvoiceResultSummaryVO> queryResultSummary(PageRequest<InvoiceSummaryDTO> query);
}
